package com.yy.controller;

//import com.groupwork.meeting.entity.Power;
//import com.groupwork.meeting.service.IPowerService;
//import com.groupwork.meeting.util.JsonResult;
import com.yy.Utils.JsonResult;
import com.yy.pojo.Power;
import com.yy.service.PowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 鱼凫
 * @version 1.0
 * Create by 2021/11/2 10:37
 * @Description //TODO
 */

@Controller
@RequestMapping("/power")
@ResponseBody
public class PowerController extends BaseController{
    @Autowired
    private PowerService powerService;

    @RequestMapping("get_by_rid")
    public JsonResult<List<Power>> getByRid(String rid) {
        List<Power> data = powerService.getPowerByRid(rid);
        return new JsonResult<>(OK,data);
    }

    @RequestMapping("get_by_uname")
    public JsonResult<List<Power>> getByUname(String username){
        List<Power> data = powerService.getPowerByUname(username);
        return new JsonResult<>(OK,data);
    }
}
